/*
 * 任务信息
 */
import { postRequest, getRequest } from '/@/lib/axios';

export const taskApi = {
   // 获取任务信息
   detail: (taskId) => {
    return getRequest(`/tm/task/get?id=${taskId}`);
  },
  // 保存任务信息
  save: (param) => {
    return postRequest('/tm/task/save', param);
  },

  // 删除任务信息
  delete: (taskId) => {
    return getRequest(`/tm/task/delete?id=${taskId}`);
  },

  // 分页查询任务信息
  pageQuery: (param) => {
    return postRequest('/tm/task/searchPage', param);
  },
  // 保存任务信息
  saveDetail: (param) => {
    return postRequest('/tm/taskDetail/save', param);
  },
  // 分页查询任务明细信息
  detailPageQuery: (param) => {
    return postRequest('/tm/taskDetail/searchPage', param);
  },
  doCompleteTask: (taskId) => {
    return getRequest(`/tm/task/doCompleteTask?taskId=${taskId}`);
  },
  batchUpdateTask:(param)=>{
    return postRequest('/tm/task/batchUpdateTask', param);
  },
  findTop10:()=>{
    return getRequest('/tm/task/findTop10');
  },
  findTaskRateTop10:()=>{
    return getRequest('/tm/task/findTaskRateTop10');
  },
  getWeeklyDataTop10:()=>{
    return getRequest('/tm/task/getWeeklyDataTop10');
  },
  getWeeklyData:(param)=>{
    return postRequest('/tm/task/getWeeklyData',param);
  },
  getWeeklyTimeData:(param)=>{
    return postRequest('/tm/taskDetail/getWeeklyTimeData',param);
  },
  getUsersData:()=>{
    return getRequest('/tm/task/getUsersData');
  },
  getManHoursCount:()=>{
    return getRequest('/tm/taskDetail/getManHoursCount');
  },
  getWeeklyManHoursSum:()=>{
    return getRequest('/tm/taskDetail/getWeeklyManHoursSum');
  },
  getHasProject:()=>{
    return getRequest('/tm/task/getHasProject');
  },
  getTestPage: (param) => {
    return postRequest('/getpageList', param);
  }

};
